import axios from 'axios';


//URL基准地址
const baseUrl = 'http://localhost:18888';

//获取体重数据
function getWeightData() {
    return axios.get(baseUrl + '/GetWeightData');
}

//添加新的体重记录
function addNewRecord(newDate, newWeight) {
    let data = new FormData();
    data.append('date', newDate);
    data.append('weight', newWeight);
    return axios.post(baseUrl + '/AddNewRecord', data);
}

export default {
    getWeightData, addNewRecord
}